package top.ajunnihao.core.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单实体类
 * </p>
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Order对象", description = "")
@TableName("`order`")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单ID")
    @TableId(value = "order_id", type = IdType.AUTO)
    private Long orderId;

    @ApiModelProperty(value = "订单数量")
    private Integer orderCount;

    @ApiModelProperty(value = "订单总价")
    private Integer orderPrice;

    @ApiModelProperty(value = "订单流水号")
    private String orderSequence;

    @ApiModelProperty(value = "订单使用时间")
    private LocalDateTime orderUseTime;

    @ApiModelProperty(value = "订单状态，true: 已支付; false: 未支付")
    private Boolean orderStatus;

    @ApiModelProperty(value = "逻辑删除")
    @TableLogic
    private Boolean deleted;

    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @ApiModelProperty(value = "门票ID")
    private Long ticketId;

    @ApiModelProperty(value = "创建日期")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    @ApiModelProperty(value = "更新日期")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtUpdate;

    @ApiModelProperty(value = "该订单所对应的门票的景点信息")
    @TableField(exist = false)
    private SiteScenic siteScenic;

    @ApiModelProperty(value = "该订单所对应的用户信息")
    @TableField(exist = false)
    private User user;

}
